<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改文件: {{ filename }}</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f7f6;
            color: #333;
        }
        .container {
            max-width: 900px;
            margin: 40px auto;
            padding: 30px;
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }
        h1 {
            color: #0056b3;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 15px;
            word-break: break-all;
        }
        form {
            display: flex;
            flex-direction: column;
        }
        textarea {
            width: 100%;
            min-height: 400px;
            padding: 15px;
            border: 1px solid #ccc;
            border-radius: 5px;
            font-size: 1rem;
            line-height: 1.5;
            margin-bottom: 20px;
            box-sizing: border-box; /* 确保 padding 不会影响宽度 */
        }
        .actions {
            margin-top: 20px;
        }
        .actions button, .actions a {
            text-decoration: none;
            color: #fff;
            padding: 10px 18px;
            border-radius: 5px;
            margin-right: 10px;
            font-size: 1rem;
            transition: background-color 0.2s ease;
            border: none;
            cursor: pointer;
        }
        .save-btn {
            background-color: #28a745;
        }
        .save-btn:hover {
            background-color: #218838;
        }
        .cancel-btn {
            background-color: #6c757d;
        }
        .cancel-btn:hover {
            background-color: #5a6268;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>修改: {{ filename }}</h1>
        <form action="{{ url_for('edit_file', filename=filename) }}" method="post">
            <textarea name="content">{{ content }}</textarea>
            <div class="actions">
                <button type="submit" class="save-btn">保存修改</button>
                <a href="{{ url_for('view_file', filename=filename) }}" class="cancel-btn">取消</a>
            </div>
        </form>
    </div>
</body>
</html>
